;; Simple test file for set! expressions

;; Basic set! functionality
(define x 10)
(display "Initial value: ")
(display x)

(set! x 20)
(display " After set! x 20: ")
(display x)

;; set! with strings
(define message "hello")
(display " Initial message: ")
(display message)

(set! message "world")
(display " After set! message world: ")
(display message)

;; set! with arithmetic expressions
(define result 0)
(display " Initial result: ")
(display result)

(set! result (+ 5 3 2))
(display " After set! result (+ 5 3 2): ")
(display result)

;; set! with variable references
(define a 5)

(define b 3)
(display " Initial a: ")
(display a)

(set! a b)
(display " After set! a b: ")
(display a)

;; Multiple set! operations



(define counter 0)
(display " Initial counter: ")
(display counter)

(set! counter (+ counter 1))
(display " After increment: ")
(display counter)

(set! counter (* counter 2))
(display " After multiply by 2: ")
(display counter)

;; set! inside begin block
(define y 100)
(display " Initial y: ")
(display y)

(begin
  (set! y 200)
  (display " Inside begin, after set! y 200: ")


  (display y)
  (set! y 300)
  (display " Inside begin, after set! y 300: ")
  (display y))

(display " Outside begin, final y: ")
(display y)